package com.example.video_module;

import com.example.common.mvvm.BaseEntity;
import com.example.common.mvvm.model.BaseRepository;
import com.example.network_sdk.RetrofitManager;


import io.reactivex.Observable;
import io.reactivex.annotations.NonNull;
import io.reactivex.functions.Function;
import okhttp3.OkHttpClient;
import retrofit2.Retrofit;
import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory;
import retrofit2.converter.gson.GsonConverterFactory;

public class VideoRepository extends BaseRepository {
    public Observable<BaseEntity>requestData(){
        Observable<VideoEntity> requestVideoData = RetrofitManager.getInstance().getRetrofit().create(ApiService.class).requestVideo();
        return requestVideoData.map(new Function<VideoEntity, BaseEntity>() {
            @Override
            public BaseEntity apply(@NonNull VideoEntity videoEntity) throws Exception {
                return videoEntity;
            }
        });
    }
}
